<?php

namespace App\Http\Controllers\Admin;

use App\Http\Query\CategoryQuery;
use app\Model\Base;
use app\Model\OrderModel;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Log;
use function MongoDB\BSON\toJSON;
use SplFileObject;

class JapanInvoiceProcessController extends Controller

{

    function invoice_process(Request $request)
    {
        $getParam = $request->all();

        $map['deliver_state'] = 1;

        $db = DB::table('user_order')->where($map);

        if (!empty($getParam['star_date']) && !empty($getParam['end_date'])) {
            $list = $db->whereBetween('create_time', [$getParam['star_date'], $getParam['end_date']])->get();
        } else {
            $list = $db->get();
        }
        $mo = new \App\Model\Base();
        return view('warehouse.invoice_process', array(
            'storehouse' => $mo::storehouse(),
            'category' => $mo::category(),
            'goods' => $mo::goods(),
            'param' => $getParam,
            'list' => $list,
        )); // 返回视图

    }
}
